#include <stdio.h>

// R. Sedgewick
typedef int node;
#define key(A) (A)
#define less(A, B) (key(A) < key(B))
#define exch(A, B) { node t = A; A = B; B = t; }
  
int main() {
  node v[10] = {1, 34, 10, 6, 8, 18, 5, 7, 23, 15};
  int i, j, min;
  for (i = 0; i < 10; i++) { 
    min = i;
    for (j = i + 1; j < 10; j++) 
      if (less(v[j], v[min])) min = j;
    exch(v[i], v[min]);
  } 
  return 0;
}

